﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraBars;
using DevExpress.UserSkins;
using DevExpress.XtraBars.Helpers;
using DevExpress.XtraBars.Ribbon;
using DevExpress.XtraBars.Ribbon.Gallery;
using Mental.Forms.KhaiBao;
using Mental.Forms.BaoMat;

namespace Mental
{
    public partial class frmMain : DevExpress.XtraBars.Ribbon.RibbonForm
    {

        public frmMain()
        {
            InitializeComponent();
            xtraTabbedMdiManager1.MdiParent = this;
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            lblDateTime.Caption = "Bây giờ là: " + (DateTime.Now.ToString("h:mm:ss tt, dd/MM/yyyy"));
        }

        private void frmMain_Load(object sender, EventArgs e)
        {
            GalleryDropDown g = new GalleryDropDown();
            g.Ribbon = ribbon;
            DevExpress.XtraBars.Helpers.SkinHelper.InitSkinGalleryDropDown(g);
            btnSkinSelector.DropDownControl = g;
            //SkinSelector

            //------------------------------------------------------------------------
            frmBanLamViec f = new frmBanLamViec();
            for (int i = 0; i < this.MdiChildren.Length; i++)
            {
                if (f.Name == this.MdiChildren[i].Name)
                {
                    this.MdiChildren[i].Activate();
                    return;
                }
            }
            f.MdiParent = this;
            f.Show();
        }

        private void btnBanLamViec_ItemClick(object sender, ItemClickEventArgs e)
        {
            frmBanLamViec f = new frmBanLamViec();
            for (int i = 0; i < this.MdiChildren.Length; i++)
            {
                if (f.Name == this.MdiChildren[i].Name)
                {
                    this.MdiChildren[i].Activate();
                    return;
                }
            }
            f.MdiParent = this;
            f.Show();
        }

        private void btnThongTinBenhVien_ItemClick(object sender, ItemClickEventArgs e)
        {
            frmThongTinVeBenhVien f = new frmThongTinVeBenhVien();
            for (int i = 0; i < this.MdiChildren.Length; i++)
            {
                if (f.Name == this.MdiChildren[i].Name)
                {
                    this.MdiChildren[i].Activate();
                    return;
                }
            }
            f.MdiParent = this;
            f.Show();
        }

        private void btnPhanQuyen_ItemClick(object sender, ItemClickEventArgs e)
        {
            frmPhanQuyen f = new frmPhanQuyen();
            for (int i = 0; i < this.MdiChildren.Length; i++)
            {
                if (f.Name == this.MdiChildren[i].Name)
                {
                    this.MdiChildren[i].Activate();
                    return;
                }
            }
            f.MdiParent = this;
            f.Show();
        }

        private void btnLyLichBenhNhan_ItemClick(object sender, ItemClickEventArgs e)
        {
            frmLyLichBenhNhan f = new frmLyLichBenhNhan();
            for (int i = 0; i < this.MdiChildren.Length; i++)
            {
                if (f.Name == this.MdiChildren[i].Name)
                {
                    this.MdiChildren[i].Activate();
                    return;
                }
            }
            f.MdiParent = this;
            f.Show();
        }

        private void btnLyLichBacSi_ItemClick(object sender, ItemClickEventArgs e)
        {
            frmLyLichBS f = new frmLyLichBS();
            for (int i = 0; i < this.MdiChildren.Length; i++)
            {
                if (f.Name == this.MdiChildren[i].Name)
                {
                    this.MdiChildren[i].Activate();
                    return;
                }
            }
            f.MdiParent = this;
            f.Show();
        }

        private void btnDanhMucThuoc_ItemClick(object sender, ItemClickEventArgs e)
        {
            frmDanhMucThuoc f = new frmDanhMucThuoc();
            for (int i = 0; i < this.MdiChildren.Length; i++)
            {
                if (f.Name == this.MdiChildren[i].Name)
                {
                    this.MdiChildren[i].Activate();
                    return;
                }
            }
            f.MdiParent = this;
            f.Show();
        }

        private void btnSoTonKho_ItemClick(object sender, ItemClickEventArgs e)
        {
            frmSoTonKho f = new frmSoTonKho();
            for (int i = 0; i < this.MdiChildren.Length; i++)
            {
                if (f.Name == this.MdiChildren[i].Name)
                {
                    this.MdiChildren[i].Activate();
                    return;
                }
            }
            f.MdiParent = this;
            f.Show();
        }

        private void btnKetQuaXetNghiem_ItemClick(object sender, ItemClickEventArgs e)
        {
            frmXetNghiem f = new frmXetNghiem();
            for (int i = 0; i < this.MdiChildren.Length; i++)
            {
                if (f.Name == this.MdiChildren[i].Name)
                {
                    this.MdiChildren[i].Activate();
                    return;
                }
            }
            f.MdiParent = this;
            f.Show();
        }
    }
}